#pragma once
#include "afxwin.h"

#include"ListBoxEx.h"

class CVaxSIPUserAgent;

class CAccountDlg : public CPropertyPage
{
	DECLARE_DYNAMIC(CAccountDlg)

private:
	CVaxSIPUserAgent* m_pVaxSIPUserAgent;

	CFont m_objFont;

public:
	CAccountDlg(CVaxSIPUserAgent* pVaxSIPUserAgent);
	virtual ~CAccountDlg();

	enum { IDD = IDD_ACCOUNT_DLG };

protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	virtual BOOL OnApply();

	DECLARE_MESSAGE_MAP()
public:
	CButton m_ctrlInitBtn;

	afx_msg void OnBtnClickedOnLine();
	afx_msg void OnBtnClickedClearLog();
	
public:
	
	CString m_sAccountUserName;
	CString m_sAccountDisplayName;
	CString m_sAccountAuthName;
	CString m_sAccountPassword;
	CString m_sAccountDomainSIP;
	CString m_sAccountProxySIP;

	int m_nTotalLines;

	BOOL m_bCheckRegisterToProxy;
	BOOL m_bCheckCaptureSoundDevic;
	CListBoxEx m_ctrlStatusLogListBox;

private:
	void AddToAccountLog(CString AccountLog);
	void saveToConfig();
	void roadFromConfig();

public:
	void OnTryingToRegister();

	void OnFailToRegister();
	void OnFailToRegisterEx(int nStatusCode, CString sReasonPhrase);

	void OnSuccessToRegister();

	void OnTryingToReRegister();
	void OnFailToReRegister();
	void OnFailToReRegisterEx(int nStatusCode, CString sReasonPhrase);

	void OnSuccessToReRegister();

	void OnTryingToUnRegister();
	void OnFailToUnRegister();
	void OnSuccessToUnRegister();
};
